package com.ym.user.controller;

import com.alibaba.fastjson.JSON;
import com.ym.user.Source;
import com.ym.utils.restful.AjaxJson;
import com.ym.utils.exception.CustomException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.integration.support.MessageBuilder;
//import org.springframework.messaging.Message;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

/**
 * @version v1.0
 * @ProjectName: SpringCloud-Alibaba-YM
 * @ClassName: TestRockerMqController
 * @Description: TODO(消息功能测试Controller)
 * @Author: 晨曦
 * @Date: 2020/10/12 13:53
 */

@Api(tags = "消息测试模块", value = "消息测试模块")
@RestController
@RequestMapping("/TestRockerMqController")
public class TestRockerMqController {
    @Autowired
   // private Source mySource;

    @ApiOperation(value = "发送消息", notes = "描述：Send发送测试消息")
    @ApiParam(name = "parmValue", value = "传输消息", defaultValue = "", required = true)
    @RequestMapping(value = "/send1", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public AjaxJson getUserInforById() throws CustomException {
        AjaxJson ajaxJson = new AjaxJson();
        Map map = new HashMap();
        map.put("name","晨曦");
       // Message<String> springMessage = MessageBuilder.withPayload(JSON.toJSONString(map)).build();
        //mySource.output1().send(springMessage);
        return ajaxJson.Success();
    }
}
